Page({

  /**
   * 页面的初始数据
   */
  data: {
    arrList: [{
        id: 0,
        image: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1089874897,1268118658&fm=26&gp=0.jpg'
      },
      {
        id: 1,
        image: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1819216937,2118754409&fm=26&gp=0.jpg'
      }, {
        id: 0,
        image: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1089874897,1268118658&fm=26&gp=0.jpg'
      },
      {
        id: 1,
        image: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1819216937,2118754409&fm=26&gp=0.jpg'
      }, {
        id: 0,
        image: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1089874897,1268118658&fm=26&gp=0.jpg'
      },
      {
        id: 1,
        image: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1819216937,2118754409&fm=26&gp=0.jpg'
      }, {
        id: 0,
        image: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1089874897,1268118658&fm=26&gp=0.jpg'
      },
      {
        id: 1,
        image: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1819216937,2118754409&fm=26&gp=0.jpg'
      }, {
        id: 0,
        image: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1089874897,1268118658&fm=26&gp=0.jpg'
      },
      {
        id: 1,
        image: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1819216937,2118754409&fm=26&gp=0.jpg'
      }, {
        id: 0,
        image: 'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1089874897,1268118658&fm=26&gp=0.jpg'
      },
      {
        id: 1,
        image: 'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1819216937,2118754409&fm=26&gp=0.jpg'
      },
    ],
    array: [false, false, false, false, false, false, false, false, false, false, false, false],
    damoHeight: '150',//demo高度
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    // 360 = 存放图片容器的模块 
    let _this = this;
    let arrayRi = _this.data.array;
    console.log(arrayRi)
    let num = Math.ceil(wx.getSystemInfoSync().windowHeight / 360);
    console.log(num);
    for (let i = 0; i < num; i++) {
      arrayRi[i] = true;
    };
    console.log(arrayRi);
    _this.setData({
      array: arrayRi
    })

  },

  // 滚动页面时触发该函数
  onPageScroll: function (e) {
    let _this = this;
    var _y = parseInt(e.scrollTop / _this.data.damoHeight);
    _this.data.array[_y + 1] = true;
    _this.setData({
      array: _this.data.array
    }); 
  }
})